package cn.bfay.lion.rest.controller;

import cn.bfay.lion.rest.service.WechatService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/wechat")
public class WechatController extends BaseController {
    private final WechatService wechatService;

    @GetMapping("/core")
    public String coreCheck() {
        return wechatService.coreCheck();
    }

    @PostMapping("/core")
    public String coreProcess() {
        // 调用核心业务类接收消息、处理消息
        return wechatService.coreProcess();
    }

    //@RequestMapping("/getJsSign")
    //@ResponseBody
    //public String jsSign(HttpServletRequest request) {
    //    String url = request.getParameter("url");
    //    Map<String, String> ret = WechatUtils.getJsSign(url);
    //    return JSONObject.toJSONString(ret);
    //}
}
